package org.dromara.cms.domain.bo;

import org.dromara.cms.domain.CmsConfig;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

/**
 * CMS系统配置业务对象 cms_config
 *
 * @author Spring
 * @date 2024-12-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = CmsConfig.class, reverseConvertGenerate = false)
public class CmsConfigBo extends BaseEntity {

    /**
     * 配置ID
     */
    @NotNull(message = "配置ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 配置键
     */
    @NotBlank(message = "配置键不能为空", groups = { AddGroup.class, EditGroup.class })
    private String configKey;

    /**
     * 配置值
     */
    @NotBlank(message = "配置值不能为空", groups = { AddGroup.class, EditGroup.class })
    private String configValue;

    /**
     * 配置名称
     */
    @NotBlank(message = "配置名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String configName;

    /**
     * 配置类型(text=文本框,textarea=文本域,select=下拉框,radio=单选框,checkbox=复选框,image=图片上传,file=文件上传,switch=开关)
     */
    @NotBlank(message = "配置类型(text=文本框,textarea=文本域,select=下拉框,radio=单选框,checkbox=复选框,image=图片上传,file=文件上传,switch=开关)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String configType;

    /**
     * 配置选项(当config_type为select,radio,checkbox时使用)
     */
     private String configOptions;

    /**
     * 配置分组(base=基础配置,system=系统配置,upload=上传配置,other=其他配置)
     */
    @NotBlank(message = "配置分组(base=基础配置,system=系统配置,upload=上传配置,other=其他配置)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String configGroup;

    /**
     * 是否系统内置(0=否,1=是)
     */
    @NotBlank(message = "是否系统内置(0=否,1=是)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String isSystem;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long sort;

    /**
     * 备注
     */
    @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
    private String remark;


}
